package com.sunfield.windpower.activity;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.sunfield.baseframe.base.BaseActivity;
import com.sunfield.windpower.R;
import com.sunfield.windpower.adapter.QuickEnterAdapter;
import com.sunfield.windpower.bean.QuickEnterInfo;
import com.sunfield.windpower.decoration.QuickEnterDecoration;
import com.sunfield.windpower.decoration.QuickEnterSpaceDecoration;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;

import java.util.ArrayList;
import java.util.List;

/**
 * 快捷进入
 * Created by wxl on 2017/2/8.
 */
@EActivity(R.layout.activity_quick_enter)
public class QuickEnterActivity extends BaseActivity {
    @ViewById
    RecyclerView rv_list;

    @Bean
    QuickEnterAdapter adapter;

    @AfterViews
    void init(){
        rv_list.setLayoutManager(new LinearLayoutManager(this));
        rv_list.addItemDecoration(new QuickEnterDecoration(adapter));
        rv_list.addItemDecoration(new QuickEnterSpaceDecoration());
        rv_list.setAdapter(adapter);

        List<QuickEnterInfo> contactList = new ArrayList<>();
        for(int i=0;i<1;i++){
            contactList.add(new QuickEnterInfo("集团总公司", R.drawable.quick_icon1));
            contactList.add(new QuickEnterInfo("运维公司", R.drawable.quick_icon2));
            contactList.add(new QuickEnterInfo("天津国银", R.drawable.quick_icon3));
        }
        adapter.setContactList(contactList);

        List<QuickEnterInfo> functionList = new ArrayList<>();
        for(int i=1;i<6;i++){
            functionList.add(new QuickEnterInfo("功能模块" + i, R.drawable.quick_icon4));
        }
        adapter.setFunctionList(functionList);
    }
}
